import { createApp } from 'vue'
import { createPinia } from 'pinia'
import App from './App.vue'
import router from './router'

const app = createApp(App)
// css适配
import '@/utils/flexible'
// 引入全局样式
import './CSS/base.css'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import zhCn from 'element-plus/es/locale/lang/zh-cn' //设置默认为中文
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
// axios
import axios from 'axios'
import VueAxios from 'vue-axios'
app.use(VueAxios, axios)
app.use(ElementPlus, { locale: zhCn })
app.use(createPinia())
app.use(router)
// v-viewer图片预览功能
import Viewer from 'v-viewer'
import 'viewerjs/dist/viewer.css'
//可以指定一些默认配置
app.use(Viewer, {
  Options: {
    inline: true,
    button: true, //右上角按钮
    navbar: true, //底部缩略图
    title: true, //当前图片标题
    toolbar: true, //底部工具栏
    tooltip: true, //显示缩放百分比
    movable: true, //是否可以移动
    zoomable: true, //是否可以缩放
    rotatable: true, //是否可旋转
    scalable: true, //是否可翻转
    transition: true, //使用 CSS3 过度
    fullscreen: true, //播放时是否全屏
    keyboard: true, //是否支持键盘
    url: 'data-source'
  }
})

app.mount('#app')
